<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::ROC Class Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="classshark_1_1_r_o_c.html">ROC</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="classshark_1_1_r_o_c-members.html">List of all members</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle"><div class="title">shark::ROC Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>ROC-Curve - false negatives over false positives.  
 <a href="classshark_1_1_r_o_c.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_r_o_c_8h_source.html">shark/Statistics/ROC.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a86d4d7fe5ba1f81b0fd212127d7679cd" id="r_a86d4d7fe5ba1f81b0fd212127d7679cd"><td class="memTemplParams" colspan="2">template&lt;class <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> &gt; </td></tr>
<tr class="memitem:a86d4d7fe5ba1f81b0fd212127d7679cd"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classshark_1_1_r_o_c.html#a86d4d7fe5ba1f81b0fd212127d7679cd">ROC</a> (<a class="el" href="classshark_1_1_abstract_model.html">AbstractModel</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, RealVector &gt; &amp;model, <a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, unsigned int &gt; const &amp;set)</td></tr>
<tr class="separator:a86d4d7fe5ba1f81b0fd212127d7679cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac88209bb77c813352b590d89a8173b5d" id="r_ac88209bb77c813352b590d89a8173b5d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a> double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_r_o_c.html#ac88209bb77c813352b590d89a8173b5d">threshold</a> (double falseAcceptanceRate) const</td></tr>
<tr class="separator:ac88209bb77c813352b590d89a8173b5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02c969175f2f4600b9668ab54b4d741a" id="r_a02c969175f2f4600b9668ab54b4d741a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a> double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_r_o_c.html#a02c969175f2f4600b9668ab54b4d741a">value</a> (double falseAcceptanceRate) const</td></tr>
<tr class="separator:a02c969175f2f4600b9668ab54b4d741a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6ac16568d496fa8875d10b2ff602040" id="r_ab6ac16568d496fa8875d10b2ff602040"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a> double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_r_o_c.html#ab6ac16568d496fa8875d10b2ff602040">equalErrorRate</a> () const</td></tr>
<tr class="memdesc:ab6ac16568d496fa8875d10b2ff602040"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the equal error rate of the classifier.  <br /></td></tr>
<tr class="separator:ab6ac16568d496fa8875d10b2ff602040"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-attribs" name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a38c4316af84e776dd793015447c6780b" id="r_a38c4316af84e776dd793015447c6780b"><td class="memItemLeft" align="right" valign="top">std::vector&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_r_o_c.html#a38c4316af84e776dd793015447c6780b">m_scorePositive</a></td></tr>
<tr class="memdesc:a38c4316af84e776dd793015447c6780b"><td class="mdescLeft">&#160;</td><td class="mdescRight">scores of the positive examples  <br /></td></tr>
<tr class="separator:a38c4316af84e776dd793015447c6780b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a276775f91a2249b01329458667c635" id="r_a3a276775f91a2249b01329458667c635"><td class="memItemLeft" align="right" valign="top">std::vector&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classshark_1_1_r_o_c.html#a3a276775f91a2249b01329458667c635">m_scoreNegative</a></td></tr>
<tr class="memdesc:a3a276775f91a2249b01329458667c635"><td class="mdescLeft">&#160;</td><td class="mdescRight">scores of the negative examples  <br /></td></tr>
<tr class="separator:a3a276775f91a2249b01329458667c635"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>ROC-Curve - false negatives over false positives. </p>
<dl class="section user"><dt></dt><dd>This class provides the <a class="el" href="classshark_1_1_r_o_c.html" title="ROC-Curve - false negatives over false positives.">ROC</a> curve of a classifier. All time consuming computations are done in the constructor, such that afterwards fast access to specific values of the curve and the equal error rate is possible.</dd></dl>
<dl class="section user"><dt></dt><dd>The <a class="el" href="classshark_1_1_r_o_c.html" title="ROC-Curve - false negatives over false positives.">ROC</a> class assumes a one dimensional target array and a model producing one dimensional output data. The targets must be the labels 0 and 1 of a binary classification task. The model output is assumed not to be 0 and 1, but real valued instead. Classification in done by thresholding, where different false positive and false negative rates correspond to different thresholds. The <a class="el" href="classshark_1_1_r_o_c.html" title="ROC-Curve - false negatives over false positives.">ROC</a> curve shows the trade off between the two error types. </dd></dl>

<p class="definition">Definition at line <a class="el" href="_r_o_c_8h_source.html#l00064">64</a> of file <a class="el" href="_r_o_c_8h_source.html">ROC.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a86d4d7fe5ba1f81b0fd212127d7679cd" name="a86d4d7fe5ba1f81b0fd212127d7679cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a86d4d7fe5ba1f81b0fd212127d7679cd">&#9670;&#160;</a></span>ROC()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a> &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">shark::ROC::ROC </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classshark_1_1_abstract_model.html">AbstractModel</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, RealVector &gt; &amp;&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classshark_1_1_labeled_data.html">LabeledData</a>&lt; <a class="el" href="_multi_task_svm_8cpp.html#a0dea9a3a85d327080d9b617903508925">InputType</a>, unsigned int &gt; const &amp;&#160;</td>
          <td class="paramname"><em>set</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Constructor</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">model</td><td>model to use for prediction </td></tr>
    <tr><td class="paramname">set</td><td>data set with inputs and corresponding binary outputs (0 or 1) </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_r_o_c_8h_source.html#l00072">72</a> of file <a class="el" href="_r_o_c_8h_source.html">ROC.h</a>.</p>

<p class="reference">References <a class="el" href="group__shark__globals.html#ga192f5eced10acf38f3ae723a3c400d98">shark::LabeledData&lt; InputT, LabelT &gt;::batch()</a>, <a class="el" href="group__shark__globals.html#ga89490b7ed6f9285ab91cae348c7437b8">shark::classSizes()</a>, <a class="el" href="classshark_1_1_r_o_c.html#a3a276775f91a2249b01329458667c635">m_scoreNegative</a>, <a class="el" href="classshark_1_1_r_o_c.html#a38c4316af84e776dd793015447c6780b">m_scorePositive</a>, <a class="el" href="_exception_8h.html#a42a6a50e4d06c00d60fbca5333f40768">SIZE_CHECK</a>, and <a class="el" href="classshark_1_1_r_o_c.html#a02c969175f2f4600b9668ab54b4d741a">value()</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ab6ac16568d496fa8875d10b2ff602040" name="ab6ac16568d496fa8875d10b2ff602040"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab6ac16568d496fa8875d10b2ff602040">&#9670;&#160;</a></span>equalErrorRate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a> double shark::ROC::equalErrorRate </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes the equal error rate of the classifier. </p>

</div>
</div>
<a id="ac88209bb77c813352b590d89a8173b5d" name="ac88209bb77c813352b590d89a8173b5d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac88209bb77c813352b590d89a8173b5d">&#9670;&#160;</a></span>threshold()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a> double shark::ROC::threshold </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>falseAcceptanceRate</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Compute the threshold for given false acceptance rate, that is, for a given false positive rate. This threshold, used for classification with the underlying model, results in the given false acceptance rate. </p>

</div>
</div>
<a id="a02c969175f2f4600b9668ab54b4d741a" name="a02c969175f2f4600b9668ab54b4d741a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a02c969175f2f4600b9668ab54b4d741a">&#9670;&#160;</a></span>value()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_d_l_l_support_8h.html#a54b73283f7f70b27fbd8ac5d4621827f">SHARK_EXPORT_SYMBOL</a> double shark::ROC::value </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>falseAcceptanceRate</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Value of the <a class="el" href="classshark_1_1_r_o_c.html" title="ROC-Curve - false negatives over false positives.">ROC</a> curve for given false acceptance rate, that is, for a given false positive rate. </p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_r_o_c.html#a86d4d7fe5ba1f81b0fd212127d7679cd">ROC()</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a3a276775f91a2249b01329458667c635" name="a3a276775f91a2249b01329458667c635"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3a276775f91a2249b01329458667c635">&#9670;&#160;</a></span>m_scoreNegative</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt;double&gt; shark::ROC::m_scoreNegative</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>scores of the negative examples </p>

<p class="definition">Definition at line <a class="el" href="_r_o_c_8h_source.html#l00128">128</a> of file <a class="el" href="_r_o_c_8h_source.html">ROC.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_r_o_c.html#a86d4d7fe5ba1f81b0fd212127d7679cd">ROC()</a>.</p>

</div>
</div>
<a id="a38c4316af84e776dd793015447c6780b" name="a38c4316af84e776dd793015447c6780b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a38c4316af84e776dd793015447c6780b">&#9670;&#160;</a></span>m_scorePositive</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt;double&gt; shark::ROC::m_scorePositive</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>scores of the positive examples </p>

<p class="definition">Definition at line <a class="el" href="_r_o_c_8h_source.html#l00125">125</a> of file <a class="el" href="_r_o_c_8h_source.html">ROC.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="classshark_1_1_r_o_c.html#a86d4d7fe5ba1f81b0fd212127d7679cd">ROC()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/shark/Statistics/<a class="el" href="_r_o_c_8h_source.html">ROC.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
